home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- __gstltihooks_used__ = False
-
- try:
- import gstltihooks
- __gstltihooks_used__ = True
- except:
- pass
-
- import sys
- if 'gobject' not in sys.modules:
- import pygtk
- pygtk.require('2.0')
-
-
- class Value:
-
- def __init__(self, type):
- if not type in ('fourcc', 'intrange', 'doublerange', 'fractionrange', 'fraction'):
- raise AssertionError
- self.type = type
-
-
-
- class Fourcc(Value):
-
- def __init__(self, string):
- Value.__init__(self, 'fourcc')
- self.fourcc = string
-
-
- def __repr__(self):
- return '<gst.Fourcc %s>' % self.fourcc
-
-
- def __eq__(self, other):
- if isinstance(other, Fourcc):
- return self.fourcc == other.fourcc
- return False
-
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
-
-
- class IntRange(Value):
-
- def __init__(self, low, high):
- Value.__init__(self, 'intrange')
- self.low = low
- self.high = high
-
-
- def __repr__(self):
- return '<gst.IntRange [%d, %d]>' % (self.low, self.high)
-
-
-
- class DoubleRange(Value):
-
- def __init__(self, low, high):
- Value.__init__(self, 'doublerange')
- self.low = low
- self.high = high
-
-
- def __repr__(self):
- return '<gst.DoubleRange [%f, %f]>' % (self.low, self.high)
-
-
-
- class FractionRange(Value):
-
- def __init__(self, low, high):
- Value.__init__(self, 'fractionrange')
- self.low = low
- self.high = high
-
-
- def __repr__(self):
- return '<gst.FractionRange [%d/%d, %d/%d]>' % (self.low.num, self.low.denom, self.high.num, self.high.denom)
-
-
-
- class Fraction(Value):
-
- def __init__(self, num, denom = 1):
-
- def _Fraction__gcd(a, b):
- while b != 0:
- tmp = a
- a = b
- b = tmp % b
- return abs(a)
-
-
- def _Fraction__simplify():
- num = self.num
- denom = self.denom
- if num < 0:
- num = -num
- denom = -denom
-
- gcd = _Fraction__gcd(num, denom)
- if gcd != 0:
- num /= gcd
- denom /= gcd
-
- self.num = num
- self.denom = denom
-
- Value.__init__(self, 'fraction')
- self.num = num
- self.denom = denom
- _Fraction__simplify()
-
-
- def __repr__(self):
- return '<gst.Fraction %d/%d>' % (self.num, self.denom)
-
-
- def __eq__(self, other):
- if isinstance(other, Fraction):
- return self.num * other.denom == other.num * self.denom
- return False
-
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
-
- def __mul__(self, other):
- if isinstance(other, Fraction):
- return Fraction(self.num * other.num, self.denom * other.denom)
- if isinstance(other, int):
- return Fraction(self.num * other, self.denom)
- raise TypeError
-
- __rmul__ = __mul__
-
- def __div__(self, other):
- if isinstance(other, Fraction):
- return Fraction(self.num * other.denom, self.denom * other.num)
- if isinstance(other, int):
- return Fraction(self.num, self.denom * other)
- return TypeError
-
-
- def __rdiv__(self, other):
- if isinstance(other, int):
- return Fraction(self.denom * other, self.num)
- return TypeError
-
-
- def __float__(self):
- return float(self.num) / float(self.denom)
-
-
- import sys
-
- try:
- dlsave = sys.getdlopenflags()
- from DLFCN import RTLD_GLOBAL, RTLD_LAZY
- except AttributeError:
- RTLD_GLOBAL = -1
- RTLD_LAZY = -1
- except ImportError:
- RTLD_GLOBAL = -1
- RTLD_LAZY = -1
- import os
- osname = os.uname()[0]
- if osname == 'Linux' and osname == 'SunOS' or osname == 'FreeBSD':
- machinename = os.uname()[4]
- if machinename == 'mips' or machinename == 'mips64':
- RTLD_GLOBAL = 4
- RTLD_LAZY = 1
- else:
- RTLD_GLOBAL = 256
- RTLD_LAZY = 1
- elif osname == 'Darwin':
- RTLD_GLOBAL = 8
- RTLD_LAZY = 1
-
- del os
- except:
- RTLD_GLOBAL = -1
- RTLD_LAZY = -1
-
- if RTLD_GLOBAL != -1 and RTLD_LAZY != -1:
- sys.setdlopenflags(RTLD_LAZY | RTLD_GLOBAL)
-
-
- try:
- import libxml2
- except:
- pass
-
- from _gst import *
- import interfaces
- if RTLD_GLOBAL != -1 and RTLD_LAZY != -1:
- sys.setdlopenflags(dlsave)
-
- del sys
- version = get_gst_version
- import warnings
- if locals().has_key('parse_bin_from_description'):
-
- def gst_parse_bin_from_description(*args, **kwargs):
- warnings.warn('gst_parse_bin_from_description() is deprecated, please use parse_bin_from_description instead', DeprecationWarning)
- return parse_bin_from_description(*args, **kwargs)
-
-
- if locals().has_key('message_new_buffering'):
-
- def gst_message_new_buffering(*args, **kwargs):
- warnings.warn('gst_message_new_buffering() is deprecated, please use message_new_buffering() instead', DeprecationWarning)
- return message_new_buffering(*args, **kwargs)
-
-
- if __gstltihooks_used__:
- gstltihooks.uninstall()
- __gstltihooks_used__ = False
- del gstltihooks
- import sys
- del sys.modules['gstltihooks']
-
-